package com.ruoyi.xh.service.impl;

import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.xh.mapper.XhUserMoneyMapper;
import com.ruoyi.xh.domain.XhUserMoney;
import com.ruoyi.xh.service.IXhUserMoneyService;

/**
 * 余额变更Service业务层处理
 * 
 * @author songjw
 * @date 2024-12-13
 */
@Service
public class XhUserMoneyServiceImpl extends ServiceImpl<XhUserMoneyMapper,XhUserMoney> implements IXhUserMoneyService {

    /**
     * 查询余额变更
     * 
     * @param id 余额变更主键
     * @return 余额变更
     */
    @Override
    public XhUserMoney selectXhUserMoneyById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询余额变更列表
     * 
     * @param xhUserMoney 余额变更
     * @return 余额变更
     */
    @Override
    public Page<XhUserMoney> selectXhUserMoneyList(XhUserMoney xhUserMoney)
    {
        return new Page<>();
    }

    /**
     * 新增余额变更
     * 
     * @param xhUserMoney 余额变更
     *
     */
    @Override
    public void insertXhUserMoney(XhUserMoney xhUserMoney)
    {
        this.save(xhUserMoney);
    }

    /**
     * 修改余额变更
     * 
     * @param xhUserMoney 余额变更
     *
     */
    @Override
    public void updateXhUserMoney(XhUserMoney xhUserMoney)
    {
        this.updateById(xhUserMoney);
    }

    /**
     * 批量删除余额变更
     * 
     * @param ids 需要删除的余额变更主键
     *
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteXhUserMoneyByIds(Long[] ids)
    {
        this.removeByIds(Stream.of(ids).collect(Collectors.toSet()));
    }
}
